package com.ruoyi.common.utils.poi.word.render;

import com.aspose.words.DocumentBuilder;
import lombok.Data;

@Data
public class PoiDataHtml extends PoiDataAfterCreateWord {
    /**
     * 书签
     */
    protected String bookmark;
    /**
     * html 内容、图片本地路径
     */
    protected String value;

    public PoiDataHtml(String bookmark, String value) {
        this.bookmark = bookmark;
        this.value = value;
    }

    @Override
    public void handle(DocumentBuilder builder) throws Exception {
        super.handle(builder);
        builder.moveToBookmark(bookmark);
        builder.insertHtml(value);
    }
}
